Scenario #2010: Create Self Debitor for Partner with Distinct Contact Data

UseCase Create Self Debitor For Partner => Debitor: D-3101000 - Test AG - main debitor

Properties

Required

Given

name value
partnerPersonTradeName Test AG
billingContactCaption Test AG - billing department
billingContactEmailAddress billing@test-ag.example.org
debitorNumberSuffix 00
billable true
vatId VAT123456
vatCountryCode DE
vatBusiness true
vatReverseCharge false
defaultPrefix tst

partnerPersonUuid

HTTP GET "/api/hs/office/relations?relationType=PARTNER&personData=Test+AG" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<hsh-alex_superuser>"` \
  `# }`
=> status: 200 OK 
[ {
  "uuid" : "f1943189-716b-46ea-8218-fa169740db15", // partnerRelationUuid
  "anchor" : {
    "uuid" : "806e75fe-7894-4422-86be-783107f07f3f", // Person: Hostsharing eG
    "personType" : "LEGAL_PERSON",
    "tradeName" : "Hostsharing eG",
    "salutation" : null,
    "title" : null,
    "givenName" : null,
    "familyName" : null
  },
  "holder" : {
    "uuid" : "00ddd2fc-8742-46e5-924c-77749d4c8ccc", // Person: Test AG
    "personType" : "LEGAL_PERSON",
    "tradeName" : "Test AG",
    "salutation" : null,
    "title" : null,
    "givenName" : null,
    "familyName" : null
  },
  "type" : "PARTNER",
  "mark" : null,
  "contact" : {
    "uuid" : "351fc296-c0f1-459a-8730-4a65b9605cee", // Contact: Test AG - China
    "caption" : "Test AG - China",
    "postalAddress" : {
      "country" : "China",
      "province" : "Guangdong Province",
      "city" : "Dongguan City",
      "street" : "No.2 Commercial Second Street",
      "district" : "Niushan Wei Wu",
      "department" : "Executive Board",
      "building" : "Thi Chi Koh Building"
    },
    "emailAddresses" : {
      "main" : "norden@test-ag.example.org"
    },
    "phoneNumbers" : {
      "phone" : "++15 999 654321"
    }
  }
} ]

In production, data this query could result in multiple outputs. In that case, you have to find out which is the right one.

BankAccount: Test AG - refund bank account

HTTP POST "/api/hs/office/bankaccounts" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<hsh-alex_superuser>"` \
  `# }` \
  <<EOF
{
  "holder" : "Test AG - refund bank account",
  "iban" : "DE88100900001234567892",
  "bic" : "BEVODEBB"
}
EOF
=> status: 201 CREATED b435c7a1-e6ef-466b-a71e-da7914720743

Contact: Test AG - billing department

HTTP POST "/api/hs/office/contacts" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<hsh-alex_superuser>"` \
  `# }` \
  <<EOF
{
  "caption" : "Test AG - billing department",
  "emailAddresses" : {
    "main" : "billing@test-ag.example.org"
  }
}
EOF
=> status: 201 CREATED e10c2148-a9d5-4cb2-8029-44cfbc2cd5e9

Create Debitor: D-3101000 - Test AG - main debitor

HTTP POST "/api/hs/office/debitors" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<hsh-alex_superuser>"` \
  `# }` \
  <<EOF
{
  "debitorRel" : {
    "anchor.uuid" : "00ddd2fc-8742-46e5-924c-77749d4c8ccc", // partnerPersonUuid
    "holder.uuid" : "00ddd2fc-8742-46e5-924c-77749d4c8ccc", // partnerPersonUuid
    "contact.uuid" : "e10c2148-a9d5-4cb2-8029-44cfbc2cd5e9" // Contact: Test AG - billing department
  },
  "debitorNumberSuffix" : "00",
  "billable" : true,
  "vatId" : "VAT123456",
  "vatCountryCode" : "DE",
  "vatBusiness" : true,
  "vatReverseCharge" : false,
  "refundBankAccount.uuid" : "b435c7a1-e6ef-466b-a71e-da7914720743", // BankAccount: Test AG - refund bank account
  "defaultPrefix" : "tst"
}
EOF
=> status: 201 CREATED 108668cb-b18c-4289-ae6e-c570cf107a0e

generated on 2026-08-10 01:37:52 for branch